<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="layout">
<head>
</head>
<body>
	<div th:fragment="pagination">
		<!-- 分页 -->
		<nav style="text-align: right;">
			<ul class="pagination col-lg-12 ">
				<li class="col-lg-4" style="margin-left: 0px;"><span
					aria-hidden="true"> 总数:<label th:text="${page.totalItem}"></label>
						&nbsp; 每页显示:<select onchange="pagination.setPageSize(this.value);">
							<option value="10">10</option>
							<option value="20">20</option>
							<option value="50">50</option>
							<option value="100">100</option>
							<option value="-1">所有</option>
					</select> &nbsp; 总页数:<label th:text="${page.totalPage}"></label>
				</span></li>
				<!-- 首页 -->
				<li th:class="${page.hasPrevious()?'':'disabled'}">
					<a th:href="'javascript:pagination.setPageNum(1);'" 
					   th:onclick="${page.hasPrevious()?'':'return false;'}"
					   aria-label="First">
						<span aria-hidden="true">&lt;&lt;&lt;</span>
					</a>
				</li>
				<!-- 上一页 -->
				<li th:class="${page.hasPrevious()?'':'disabled'}">
					<a th:href="'javascript:pagination.setPageNum(' + ${page.pageNum-1} + ');'"
					aria-label="Previous"
					th:onclick="${page.hasPrevious()?'':'return false;'}"> 
					<span aria-hidden="true">&laquo;</span>
					</a>
				</li>
				<li
					th:each="pageNo : ${#numbers.sequence(page.startPageNum, page.endPageNum)}"
					th:class="${page.pageNum eq pageNo}? 'active' : ''">
					<a
					th:href="'javascript:pagination.setPageNum(' + ${pageNo} + ');'" th:text="${pageNo}"></a></li>
				<!-- 下一页 -->
				<li th:class="${page.hasNext()?'':'disabled'}"> 
				<a th:href="'javascript:pagination.setPageNum(' + ${page.pageNum+1} + ');'"
					th:onclick="${page.hasNext()?'':'return false;'}"
					aria-label="Next"> 
					<span aria-hidden="true">&raquo;</span>
				</a>
				</li>
				<!-- 尾页 -->
				<li th:class="${page.hasNext()?'':'disabled'}">
					<a th:href="'javascript:pagination.setPageNum(' + ${page.totalPage} + ');'"
					   th:onclick="${page.hasNext()?'':'return false;'}" aria-label="Next">
					<span aria-hidden="true">&gt;&gt;&gt;</span>
					</a>
				</li>
			</ul>
		</nav>
	</div>
</body>
</html>